package org.anti996.bankms.view;

import org.anti996.bankms.model.Card;
import org.anti996.bankms.util.MessageUtil;

import java.util.List;

public class UserCardView implements ViewBase {
    private final List<Card> cards_;

    public UserCardView(List<Card> cards) {
        cards_ = cards;
    }

    @Override
    public void show() {
        MessageUtil.title("银行卡总览");
        MessageUtil.infoln("您所有的银行卡如下：");
        String[] cardList = new String[cards_.size()];
        for (int i = 0; i < cards_.size(); i++) {
            cardList[i] = Card.describe(cards_.get(i));
        }
        MessageUtil.itemList(cardList);
    }
}
